package com.socialuni.common.user.sdk.utils.model;

import com.socialuni.common.utils.BirthdayAgeUtil;
import com.socialuni.uniapp.sdk.model.UniProviderLoginQO;
import com.socialuni.common.user.model.DO.CommonUserDO;

public class CommonUserDOUtil {
    public static CommonUserDO providerLoginQOToDO(UniProviderLoginQO loginQO) {
        CommonUserDO user = new CommonUserDO();
        user.setNickname(loginQO.getNickName());
        user.setAvatar(loginQO.getAvatarUrl());
        user.setGender(loginQO.getGender());
        user.setBirthday(loginQO.getBirthday());
        user.setAge(BirthdayAgeUtil.getAgeByBirth(loginQO.getBirthday()));
        user.setCity(loginQO.getCity());
        return user;
    }
}